using log4net;

namespace UniAspect.UnityCommon.ResolutionLogging
{
    public class Log4NetResolutionLogger : IResolutionLoggerPolicy
    {
        private readonly ILog _logger;

        public Log4NetResolutionLogger()
        {
            _logger = LogManager.GetLogger(GetType());
        }

        public void LogResolutionStarted(int depth, object buildKey)
        {
            _logger.Debug(string.Format("{0}: Resolving Build Key {1}", depth, buildKey));
        }

        public void LogResolutionCompleted(int depth, object originalBuildKey, object finalBuildKey, object result)
        {
            _logger.Debug(string.Format("{0}: Resolved Build Key {1} as Build Key {2}, object = {3}",
                                        depth, originalBuildKey, finalBuildKey, result));
        }
    }
}